<?php
namespace app\index\controller;

use think\Controller;
use think\View;

class Index extends Controller
{
    public function index()
    {
        $view=new View('index');
        $files = readFileNames(__DIR__);
        $controllers=array();
        foreach ($files as $file) {
            if ($file != "Index.php") {
                $controllers[] = str_replace(".php", "", $file);
            }
        }
        $view->assign("controllers",$controllers);
        return $view->fetch();
    }
}
